<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:st1="urn:schemas-microsoft-com:office:smarttags" xmlns="http://www.w3.org/TR/REC-html40"><head>


<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<meta name="ProgId" content="Word.Document">
<meta name="Generator" content="Microsoft Word 11">
<meta name="Originator" content="Microsoft Word 11">
<link rel="File-List" href="http://online-judge.uva.es/p/v110/c_files/filelist.xml">
<link rel="Edit-Time-Data" href="http://online-judge.uva.es/p/v110/c_files/editdata.mso">
<!--[if !mso]>
<style>
v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style>
<![endif]-->
<title>Problem C - Add Again</title>
<o:smarttagtype namespaceuri="urn:schemas-microsoft-com:office:smarttags" name="place"></o:smarttagtype>
<o:smarttagtype namespaceuri="urn:schemas-microsoft-com:office:smarttags" name="State"></o:smarttagtype>
<!--[if gte mso 9]><xml>
 <o:DocumentProperties>
  <o:Author>Shahriar Manzoor</o:Author>
  <o:LastAuthor>Shahriar Manzoor</o:LastAuthor>
  <o:Revision>116</o:Revision>
  <o:TotalTime>145</o:TotalTime>
  <o:Created>2004-05-17T15:23:00Z</o:Created>
  <o:LastSaved>2006-08-31T05:36:00Z</o:LastSaved>
  <o:Pages>1</o:Pages>
  <o:Words>152</o:Words>
  <o:Characters>872</o:Characters>
  <o:Company>ACM/ICPC</o:Company>
  <o:Lines>7</o:Lines>
  <o:Paragraphs>2</o:Paragraphs>
  <o:CharactersWithSpaces>1022</o:CharactersWithSpaces>
  <o:Version>11.5606</o:Version>
 </o:DocumentProperties>
</xml><![endif]--><!--[if gte mso 9]><xml>
 <w:WordDocument>
  <w:View>Print</w:View>
  <w:Zoom>BestFit</w:Zoom>
  <w:SpellingState>Clean</w:SpellingState>
  <w:GrammarState>Clean</w:GrammarState>
  <w:ValidateAgainstSchemas/>
  <w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid>
  <w:IgnoreMixedContent>false</w:IgnoreMixedContent>
  <w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText>
  <w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel>
 </w:WordDocument>
</xml><![endif]--><!--[if gte mso 9]><xml>
 <w:LatentStyles DefLockedState="false" LatentStyleCount="156">
 </w:LatentStyles>
</xml><![endif]--><!--[if !mso]><object
 classid="clsid:38481807-CA0E-42D2-BF39-B33AF135CC4D" id=ieooui></object>
<style>
st1\:*{behavior:url(#ieooui) }
</style>
<![endif]-->
<style>
<!--
 /* Font Definitions */
 @font-face
	{font-family:TimesNewRoman;
	panose-1:0 0 0 0 0 0 0 0 0 0;
	mso-font-charset:0;
	mso-generic-font-family:roman;
	mso-font-format:other;
	mso-font-pitch:auto;
	mso-font-signature:3 0 0 0 1 0;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
	{mso-style-parent:"";
	margin:0in;
	margin-bottom:.0001pt;
	mso-pagination:widow-orphan;
	font-size:12.0pt;
	font-family:"Times New Roman";
	mso-fareast-font-family:"Times New Roman";}
h1
	{mso-style-next:Normal;
	margin:0in;
	margin-bottom:.0001pt;
	text-align:justify;
	mso-pagination:widow-orphan;
	page-break-after:avoid;
	mso-outline-level:1;
	font-size:12.0pt;
	mso-bidi-font-size:10.0pt;
	font-family:"Times New Roman";
	color:black;
	mso-font-kerning:0pt;
	font-weight:normal;
	font-style:italic;}
h2
	{mso-style-next:Normal;
	margin:0in;
	margin-bottom:.0001pt;
	mso-pagination:widow-orphan;
	page-break-after:avoid;
	mso-outline-level:2;
	font-size:12.0pt;
	font-family:Arial;
	font-weight:bold;}
h3
	{mso-style-next:Normal;
	margin-top:12.0pt;
	margin-right:0in;
	margin-bottom:3.0pt;
	margin-left:0in;
	mso-pagination:widow-orphan;
	page-break-after:avoid;
	mso-outline-level:3;
	font-size:13.0pt;
	font-family:Arial;
	font-weight:bold;}
h4
	{mso-style-next:Normal;
	margin:0in;
	margin-bottom:.0001pt;
	mso-pagination:widow-orphan;
	page-break-after:avoid;
	mso-outline-level:4;
	font-size:12.0pt;
	mso-bidi-font-size:10.0pt;
	font-family:"Times New Roman";
	color:black;
	font-weight:normal;}
p.MsoHeading7, li.MsoHeading7, div.MsoHeading7
	{mso-style-next:Normal;
	margin:0in;
	margin-bottom:.0001pt;
	mso-pagination:widow-orphan;
	page-break-after:avoid;
	mso-outline-level:7;
	mso-layout-grid-align:none;
	text-autospace:none;
	font-size:11.0pt;
	mso-bidi-font-size:10.0pt;
	font-family:"Courier New";
	mso-fareast-font-family:"Times New Roman";
	font-weight:bold;}
p.MsoTitle, li.MsoTitle, div.MsoTitle
	{margin:0in;
	margin-bottom:.0001pt;
	text-align:center;
	mso-pagination:widow-orphan;
	mso-layout-grid-align:none;
	text-autospace:none;
	font-size:18.0pt;
	mso-bidi-font-size:1.0pt;
	font-family:"Times New Roman";
	mso-fareast-font-family:"Times New Roman";
	font-weight:bold;}
p.MsoBodyText, li.MsoBodyText, div.MsoBodyText
	{margin:0in;
	margin-bottom:.0001pt;
	text-align:justify;
	mso-pagination:widow-orphan;
	mso-layout-grid-align:none;
	text-autospace:none;
	font-size:12.0pt;
	mso-bidi-font-size:10.0pt;
	font-family:TimesNewRoman;
	mso-fareast-font-family:"Times New Roman";
	mso-bidi-font-family:"Times New Roman";}
p.MsoSubtitle, li.MsoSubtitle, div.MsoSubtitle
	{margin:0in;
	margin-bottom:.0001pt;
	text-align:center;
	mso-pagination:widow-orphan;
	mso-layout-grid-align:none;
	text-autospace:none;
	font-size:24.0pt;
	mso-bidi-font-size:1.0pt;
	font-family:"Times New Roman";
	mso-fareast-font-family:"Times New Roman";
	font-weight:bold;}
a:link, span.MsoHyperlink
	{color:#772222;
	text-decoration:underline;
	text-underline:single;}
a:visited, span.MsoHyperlinkFollowed
	{color:purple;
	text-decoration:underline;
	text-underline:single;}
p
	{mso-margin-top-alt:auto;
	margin-right:0in;
	mso-margin-bottom-alt:auto;
	margin-left:0in;
	mso-pagination:widow-orphan;
	font-size:12.0pt;
	font-family:"Times New Roman";
	mso-fareast-font-family:"Times New Roman";}
pre
	{margin:0in;
	margin-bottom:.0001pt;
	mso-pagination:widow-orphan;
	tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;
	font-size:10.0pt;
	font-family:"Courier New";
	mso-fareast-font-family:"Courier New";}
span.StyleArial16pt
	{mso-style-name:"Style Arial 16 pt";
	mso-ansi-font-size:16.0pt;
	font-family:Arial;
	mso-ascii-font-family:Arial;
	mso-hansi-font-family:Arial;
	mso-bidi-font-family:Arial;
	font-weight:bold;}
span.SpellE
	{mso-style-name:"";
	mso-spl-e:yes;}
@page Section1
	{size:8.5in 11.0in;
	margin:1.0in 1.0in 1.0in 1.0in;
	mso-header-margin:.5in;
	mso-footer-margin:.5in;
	mso-paper-source:0;}
div.Section1
	{page:Section1;}
-->
</style>
<!--[if gte mso 10]>
<style>
 /* Style Definitions */
 table.MsoNormalTable
	{mso-style-name:"Table Normal";
	mso-tstyle-rowband-size:0;
	mso-tstyle-colband-size:0;
	mso-style-noshow:yes;
	mso-style-parent:"";
	mso-padding-alt:0in 5.4pt 0in 5.4pt;
	mso-para-margin:0in;
	mso-para-margin-bottom:.0001pt;
	mso-pagination:widow-orphan;
	font-size:10.0pt;
	font-family:"Times New Roman";
	mso-ansi-language:#0400;
	mso-fareast-language:#0400;
	mso-bidi-language:#0400;}
</style>
<![endif]-->
<meta content="" name="Author">
<meta content="" name="Keywords">
<meta content="" name="Description">
<!--[if gte mso 9]><xml>
 <o:shapedefaults v:ext="edit" spidmax="8194"/>
</xml><![endif]--><!--[if gte mso 9]><xml>
 <o:shapelayout v:ext="edit">
  <o:idmap v:ext="edit" data="1"/>
 </o:shapelayout></xml><![endif]-->
</head><body style="" lang="EN-US" link="#772222" vlink="purple">

<div class="Section1">

<p class="MsoNormal" style="text-align: center;" align="center"><b style=""><span style="font-size: 28pt; font-family: Arial;">Problem C</span></b><span style="font-family: Arial;"><br>
</span><b style=""><span style="font-size: 20pt; font-family: Arial;">Add Again</span></b><span style="font-family: Arial;"><br>
<b style="">Input: </b><span style="">Standard Input<o:p></o:p></span></span></p>

<p class="MsoNormal" style="text-align: center;" align="center"><b style=""><span style="font-family: Arial;">Output: </span></b><span style="font-family: Arial;">Standard Output</span></p>

<p class="MsoNormal"><o:p>&nbsp;</o:p></p>

<p class="MsoNormal" style="text-align: justify;">Summation of sequence of integers
is always a common problem in Computer Science. Rather than computing blindly,
some intelligent techniques make the task simpler. Here you have to find the
summation of a sequence of integers. The sequence is an interesting one and it
is the all possible permutations of a given set of digits. For example, if the
digits are &lt;1 2 3&gt;, then six possible permutations are &lt;123&gt;,
&lt;132&gt;, &lt;213&gt;, &lt;231&gt;, &lt;312&gt;, &lt;321&gt; and the sum of
them is 1332.</p>

<p class="MsoNormal"><o:p>&nbsp;</o:p></p>

<h3><span style="font-size: 16pt;">Input<o:p></o:p></span></h3>

<p class="MsoNormal" style="text-align: justify;">Each input set will start with a
positive integer<b style=""> </b>N (1&#8804;N&#8804;12).
The next line will contain N decimal digits. Input will be terminated by N=0.
There will be at most 20000 test set.</p>

<p class="MsoNormal" style="text-align: justify;"><o:p>&nbsp;</o:p></p>

<h3><span style="font-size: 16pt;">Output<o:p></o:p></span></h3>

<p class="MsoNormal" style="text-align: justify;">For each test set, there should
be a one line output containing the summation. The value will fit in 64-bit
unsigned integer.</p>

<p class="MsoNormal" style="text-align: justify;"><o:p>&nbsp;</o:p></p>

<h1><b><span style="font-size: 16pt; font-family: Arial; font-style: normal;">Sample
Input<span style="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span>Output
for Sample Input<o:p></o:p></span></b></h1>

<table class="MsoNormalTable" style="border: medium none ; background: rgb(204, 204, 204) none repeat scroll 0% 0%; -moz-background-clip: border; -moz-background-origin: padding; -moz-background-inline-policy: continuous; border-collapse: collapse;" border="1" cellpadding="0" cellspacing="0">
 <tbody><tr style="">
  <td style="border: 1pt solid windowtext; padding: 0in 5.4pt; width: 3.2in;" valign="top" width="307">
  <p class="MsoNormal"><b style=""><span style="font-size: 11pt; font-family: &quot;Courier New&quot;;">3<o:p></o:p></span></b></p>
  <p class="MsoNormal"><b style=""><span style="font-size: 11pt; font-family: &quot;Courier New&quot;;">1 2 3<o:p></o:p></span></b></p>
  <p class="MsoNormal"><b style=""><span style="font-size: 11pt; font-family: &quot;Courier New&quot;;">3<o:p></o:p></span></b></p>
  <p class="MsoNormal"><b style=""><span style="font-size: 11pt; font-family: &quot;Courier New&quot;;">1 <span class="SpellE">1</span>
  2<o:p></o:p></span></b></p>
  <p class="MsoNormal"><b style=""><span style="font-size: 11pt; font-family: &quot;Courier New&quot;;">0<o:p></o:p></span></b></p>
  <pre><b><span style=""><o:p>&nbsp;</o:p></span></b></pre></td>
  <td style="border-style: solid solid solid none; border-color: windowtext windowtext windowtext -moz-use-text-color; border-width: 1pt 1pt 1pt medium; padding: 0in 5.4pt; width: 231.85pt;" valign="top" width="309">
  <p class="MsoNormal"><b style=""><span style="font-size: 11pt; font-family: &quot;Courier New&quot;;">1332<o:p></o:p></span></b></p>
  <p class="MsoNormal"><b style=""><span style="font-size: 11pt; font-family: &quot;Courier New&quot;;">444<o:p></o:p></span></b></p>
  <p class="MsoNormal" style=""><b><span style="font-size: 11pt; font-family: &quot;Courier New&quot;;"><o:p>&nbsp;</o:p></span></b></p>
  </td>
 </tr>
</tbody></table>

<div class="MsoNormal" style="text-align: center;" align="center">

<hr size="2" width="100%" align="center">

</div>

<p class="MsoNormal"><span class="SpellE">Problemsetter</span>: <st1:place w:st="on"><st1:state w:st="on">Md.</st1:state></st1:place> <span class="SpellE">Kamruzzaman</span> </p>

<p class="MsoNormal">Special Thanks: Shahriar Manzoor</p>

<p class="MsoNormal"><o:p>&nbsp;</o:p></p>

<p class="MsoNormal"><o:p>&nbsp;</o:p></p>

</div>

</body></html>